﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using ATMServiceLibrary.DAO;

namespace ATMServiceLibrary
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in both code and config file together.
    public class ATMService : IATMService
    {
         public void ThemGiaoDichChuyenKhoan(DTO.GiaoDichChuyenKhoanDTO giaoDich)
        {
            GiaoDichChuyenKhoanDAO GiaoDichChuyenKhoanDAO = new GiaoDichChuyenKhoanDAO();
            GiaoDichChuyenKhoanDAO.ThemGiaoDichChuyenKhoan(giaoDich);
        }

        public void ThemGiaoDichRutTien(DTO.GiaoDichRutTienDTO giaoDich)
        {
            GiaoDichRutTienDAO GiaoDichRutTienDAO = new GiaoDichRutTienDAO();
            GiaoDichRutTienDAO.ThemGiaoDichRutTien(giaoDich);
            
        }

        public DTO.TaiKhoanDTO DangNhap(DTO.DangNhapDTO info)
        {
            TaiKhoanDAO taiKhoangDAO = new TaiKhoanDAO();
            return taiKhoangDAO.DangNhap(info);
        }

        public DTO.TaiKhoanDTO LayThongTinTaiKhoanNhan(string MaThe)
        {
            TaiKhoanDAO taiKhoangDAO = new TaiKhoanDAO();
            return taiKhoangDAO.LayThongTinTaiKhoanNhan(MaThe);
        }

        public double LaySoDuTaiKhoan(string MaThe)
        {
            TaiKhoanDAO taiKhoangDAO = new TaiKhoanDAO();
            return taiKhoangDAO.LaySoDuTaiKhoan(MaThe);
        }

        public void CapNhatSoDuTaiKhoan(string MaThe, double soDu)
        {
            TaiKhoanDAO taiKhoangDAO = new TaiKhoanDAO();
            taiKhoangDAO.CapNhatSoDuTaiKhoan(MaThe, soDu);
        }
    }
}
